package com.chinasoft.one_to_many;

import com.chinasoft.bean.Classes;
import com.chinasoft.bean.Person;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ClassesMapper {

    @Select("select * from classes")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(
                    property = "students",
                    javaType = List.class,
                    column = "id",
                    many = @Many(select = "com.chinasoft.one_to_many.StudentMapper.selectByCid")
            )

    })

    public List <Classes> selectAll();
}
